package com.tom.chain_of_responsibility.v3.config;

import com.tom.chain_of_responsibility.model.req.UserSearchReq;
import com.tom.chain_of_responsibility.v3.GeneralChainHandler;
import com.tom.chain_of_responsibility.v3.factory.GeneralFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * @author zx
 * @date 2024-10-10 21:49
 */
@Configuration
public class GeneralChainConfig {

    @Bean
    public GeneralFactory<UserSearchReq, Boolean> requestRequestHandlerFactory(List<GeneralChainHandler<UserSearchReq, Boolean>> requestHandlers) {
        return new GeneralFactory<>(requestHandlers);
    }

    @Bean
    public GeneralFactory<Object, Boolean> otherTypeFactory(List<GeneralChainHandler<Object, Boolean>> requestHandlers) {
        return new GeneralFactory<>(requestHandlers);
    }
}

